<?php
include APPPATH."views/frontend/inc/01_meta.php";
include APPPATH."views/frontend/inc/02_head.php";
include APPPATH."views/frontend/inc/04_slider.php";
?>
<div class="navi">
	<a href="/home">Trang chủ</a>
	<span>/</span>
	<span class="active">Mua bán</span>
	<div class="clear"></div>
	<?php include APPPATH."views/frontend/inc/05_social.php"; ?>
</div>
<script src="/libraries/lightgallery/js/lightGallery.js"></script>
<link rel="stylesheet"  href="/libraries/lightgallery/css/lightGallery.css"/>
<script type="text/javascript">
  $(document).ready(function() {
    $(".cake-item .nailthumb").lightGallery({
        caption:true,rel:true
    }); 
  });
</script>
<div class="container">
	<div class="col-xs-12 page-title">NGUYÊN LIỆU - DỤNG CỤ LÀM BÁNH</div>
	<div class="clear"></div>
	<?php foreach($products as $cake){ 
			$thumb = $cake->product_thumb;
			$thumb = preg_replace('/\/data/','',$thumb,1);
			if(file_exists(APPPATH. "../data/thumbs/$thumb") && is_file(APPPATH. "../data/thumbs/$thumb")){
				$cake->small_thumb = "/data/thumbs$thumb";
			}else{
			$cake->small_thumb = $cake->product_thumb;
			}
	?>
		<div class="col-md-4 col-sxs-6">
			<div class="cake-item flip-container">
				<div class="nailthumb" data-rel="imageGallery">
					<div class="nailthumb-figure"
						data-title="<?php echo $cake->product_title?>" 
						data-src="<?php echo $cake->product_thumb?>"
						>
						<div class="nailthumb-container">
							<div class="front">
								<img class="flu lazy" data-original="<?php echo $cake->small_thumb?>"
									alt="<?php echo $cake->product_title?>"
									/>
							</div>
							<div class="back">
								<img class="flu wp-image-55 lazy" data-original="<?php echo $cake->small_thumb?>"
									alt="<?php echo $cake->product_title?>"
									/>
							</div>
						</div>
						<!--<div class="nailthumb-mark"></div>-->
					</div>
				</div>
				<div>
					<div class="cake-title"><?php echo $cake->product_title?></div>
					<div class="cake-desc"><?php echo $cake->product_desc?></div>
				</div>
			</div>
		</div>
	<?php } ?>
</div>
<?php
include APPPATH."views/frontend/inc/03_foot.php";
?>